{include file="header.tpl"}
<script type="text/javascript">
function checkPartyCombo()
{
	var party        = $('#party').val();
	var kaarigar     = $('#kaarigar').val();
	var bullionParty = $('#bullionParty').val();
	var bhatthiParty = $('#bhatthiParty').val();

	if((party == 1 && kaarigar == 1 && bullionParty == 1 && bhatthiParty == 1) || (party != 0 && kaarigar != 0) || (party != 0 && bullionParty != 0) || (party != 0 && bhatthiParty != 0) || (kaarigar != 0 && bullionParty != 0) || (kaarigar != 0 && bhatthiParty != 0) || (bullionParty != 0 && bhatthiParty != 0))
	{
		alert('Only One Party Select');
		return false;
	}
}
</script>
<form name="form1" action="" method="post" onsubmit="return checkPartyCombo();">
<input type="hidden" name="rojmelId" value="{$rojmel.id}" />
<div class="contentDiv">
  <table align="center">
  <tr>
    <td>
      {$l_partySelect} :
        <select name="party" id="party">
        {html_options values=$party.partyId output=$party.partyName selected=$vepaariPartyId}
      </select>
    </td>
    <td align="center">
      {$l_kaarigarName} :
      <select name="kaarigar" id="kaarigar">
        {html_options values=$kaarigar.id  output=$kaarigar.name selected=$kaarigarPartyId}
      </select>
    </td>
    <td colspan="5" >
      {$l_bullionpartySelect} :
        <select name="bullionParty" id="bullionParty">
        {html_options values=$partyBullion.partyId output=$partyBullion.bullionPartyName selected=$bullionPartyId}
      </select>
    </td>
    <td>
      {$l_bhatthiParty} :
      <select name="bhatthiParty" id="bhatthiParty">
        {html_options values=$bhatthiParty.id  output=$bhatthiParty.name selected=$bhatthiPartyRojmelId}
      </select> 
    </td>

  </tr>
  <tr>
    <td align="right"><br/><br/>{$l_date} : </td>
    <td><br/><br/>{html_select_date prefix="curDate" start_year="-2" end_year="+1" field_order="DMY" time=$rojmel.date}</td>
  </tr>
  <tr>
    <td align="right">{$l_credit} / {$l_debit} : </td>
    <td>
      <select name="crdr">
        <option value="Dr">{$l_debit}</option>
        <option value="Cr">{$l_credit}</option>
      </select>
    </td>
  </tr>
  <tr>
    <td align="right">{$l_particulars} : </td>
    <td><input type="text" name="particulars" value="{$rojmel.particulars}" /></td>
  </tr>
  <tr>
    <td align="right">{$l_fine} : </td>
    <td><input type="text" name="fine" value="{$rojmel.fine}"/></td>
  </tr>
  <tr>
    <td align="right">{$l_amount} : </td>
    <td><input type="text" name="amount" value="{$rojmel.amount}" /></td>
  </tr>
  <tr>
    <td align="right">
      <input type="submit" name="submitBtn" value="{if $rojmel|@count > 0}{$l_save}{else}{$l_add}{/if}" />
      <input type="submit" name="cancelBtn" value="{if $rojmel|@count > 0}Cancel{else}Cancel{/if}" />
    </td>
  </tr>
  </table>
</div>
</form>
<script type="text/javascript">
{if $rojmel|@count > 0}
  for(var a=0 ; a < document.form1.crdr.length ; a++)
  {  
    if(document.form1.crdr[a].value == "{$rojmel.CrDr}")
      document.form1.crdr[a].selected = true;
  }
{/if}
</script>
{include file="footer.tpl"}